<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <th:block th:replace="headfoot/head::head_common"></th:block>
</head>
<body>
<div class="container-fluid kj-list-container">
    <div class="kj-list-content-container card">
        <form id="queryForm" class="form-horizontal kj-list-queryFrom">

            <div class="kj-list-queryFrom-container">
                <div class="kj-list-queryFrom-item">
                    <div class="form-group col-sm-12">

                        <label class="col-sm-1 control-label kj-list-query-label" title="课程名称">课程名称</label>
                        <div class="col-sm-2">
                            <input type="text" class="form-control input-sm input-sm" name="name" placeholder="班级名称"/>
                        </div>

                        <label class="col-sm-1 control-label kj-list-query-label" title="学期">学期</label>
                        <div class="col-sm-2">
                            <select class="form-control input-sm " id="term" name="term" data-value="" vic:dict="term"
                                data-option="--请选择--">
                            </select>
                        </div>


                        <div class="col-sm-3 kj-list-query-btn-container">
                            <button type="button" class="btn btn-sm btn-default kj-btn-query query">
                                <i class="iconfont icon-chaxun"></i> 查询
                            </button>
                            <button type="button" class="btn btn-sm btn-default kj-btn-reset reset">
                                <i class="iconfont icon-zhongzhi"></i>重置
                            </button>
                        </div>

                    </div>

                </div>
            </div>

            <!-- 收起展开按钮 -->
            <div class="kj-packUpdiv"
            ><span class="kj-packUp-span"
            ><i
                    id="kj_slideBtn"
                    class="kj-packUpdiv-icon kj-icon-shou-by-listpage"
                    onclick="common.slideSearchDiv();"
            ></i
            ></span
            ></div>

            <div
                    id="kj_list_content_btn_container"
                    class="kj-list-content-btn-container form-group col-sm-12">
                <button
                        type="button"
                        class="btn btn-sm btn-default add-multitab kj-btn-add"
                        data-id="add-user-form"
                        data-url="/student/course/form"
                        data-title="新增课程"
                >
                    <i class="iconfont icon-tianjia"></i>&ensp;添加
                </button>

                <button
                        class="btn btn-sm btn-default kj-btn-del bootable-action-post"
                        type="button"
                        data-table="#table"
                        data-href="/student/classes/batchDelete"
                        data-confirm="确认删除吗"
                >
                    <i class="iconfont icon-shanchu"></i>&ensp;删除
                </button>
            </div>
        </form>

        <table
                id="table"
                class="table table-bordered table-hover table-striped bootstrapTable kj-list-container-only-table"
                data-list-url="/student/course/list"
                data-form-url="/student/course/form"
                data-del-url="/student/course/delete"
                data-toolbar="#queryForm"
                data-height="800"
        >
            <thead>
            <tr>
                <th data-checkbox="true"></th>
                <th data-field="name" data-sortable="false">课程名</th>
                <th data-field="termName" data-sortable="false">学期</th>
                <th data-field="status" data-sortable="false" data-formatter="showStatus">状态</th>
                <th data-field="createTime" data-sortable="true" >创建时间</th>
                <th data-field="operate" data-formatter="defaultOperate"
                    data-events="defaultOperateEvent">操作
                </th>
            </tr>
            </thead>
        </table>
    </div>
</div>

<th:block th:replace="headfoot/foot::list_foot"></th:block>
<script>
    function showStatus(value, row, index, field) {
        var text = value === 1 ? "开课中" : "已关闭";
        var labelClass = $nojs.randomLabel.getRandomLableClass(value+1);
        return '<span class="' + labelClass + '">' + text + '</span>';
    }

</script>

</body>
</html>